package xuhaijia.lanou3g.autohome.forum.hotinvitation;
//                .-~~~~~~~~~-._       _.-~~~~~~~~~-.
//            __.'              ~.   .~              `.__
//          .'//                  \./                   \\`.
//        .'//            为什么坚持  想一想当初             \\`.
//      .'// .-~"""""""~~~~-._     |     _,-~~~~"""""""~-.  \\`.
//    .'//.-"                 `-.  |  .-'                 "-. \\`.
//  .'//______.============-..   \ | /   ..-============._______\\`.
//.'//____________________________\|/_____________________________\\`.
// 
//                             

import android.widget.ListView;
import android.widget.TextView;

import xuhaijia.lanou3g.autohome.R;
import xuhaijia.lanou3g.autohome.base.BaseFragment;
import xuhaijia.lanou3g.autohome.base.MyApp;
import xuhaijia.lanou3g.autohome.base.NetTool;
import xuhaijia.lanou3g.autohome.base.URLValues;

/**
 * Created by 7 on 16/8/16.
 */
public class HotInvitationFragment extends BaseFragment {

    private ListView lv;

    @Override
    protected int setLayout() {
        return R.layout.fragment_hotinvitation;
    }

    @Override
    protected void initView() {
        TextView tv = bindView(R.id.hotinvitation_tv);
        tv.setText("24小时内热门");
        lv = bindView(R.id.hotinvitation_lv);
    }

    @Override
    protected void initData() {
        final HotInvitationAdapter adapter = new HotInvitationAdapter(MyApp.getContext());
        mNetTool.getNetData(URLValues.TOP_POSTS_URL, HotInvitationBean.class, new NetTool.NetListener<HotInvitationBean>() {
            @Override
            public void onSuccess(HotInvitationBean hotInvitationBean) {
                adapter.setBean(hotInvitationBean);
                lv.setAdapter(adapter);
            }
            @Override
            public void onError(String errorMsg) {
            }
        }) ;
    }

    @Override
    public void load() {

    }

    @Override
    public void refresh() {

    }
}
